#include <iostream>
#include<unordered_set>
using namespace std;

int cha(int* &A, int l, int r)
{
	unordered_set<int>s;
	l--;
	r--;
	for (int i = l; i <= r; i++)
	{
		s.insert(A[i]);
	}
	return s.size();
}
void change(int* &A, int k, int x)
{
	A[k - 1] = x;
}
int main()
{
	int n,m;
	//cin >> n>>m;
	scanf_s("%d", &n);

	//输入贝壳种类
	float x, a, b, c;
	for (int i = 0; i < n; i++)
	{
		scanf_s("%f%f%f%f", &x,&a,&b,&c);
		float time= x / (a + b);
		printf("%0.3f ", time*c);
		printf("%0.3f", time);
		if(i!=n-1){ printf("\n"); }
		//cin >> A[i];
			
	}

}